wayland: Add surface to toplevel list only if toplevel
authorJonas Ådahl <jadahl@gmail.com>
Tue, 17 Mar 2020 14:28:14 +0000 (15:28 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Wed, 8 Apr 2020 21:32:47 +0000 (23:32 +0200)
It was using another check (has parent) to do this, but now we have a
much more obvious way of creating surfaces, so we can use the type
directly.

gdk/wayland/gdksurface-wayland.c

index 9b18d199937d3c01ec147718be9613e75c653d4c..f910c8b9fd1c066d690592e77b4ccd03d7c52184 100644 (file)
@@ -700,6 +700,9 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
                               "display", display,
                               "frame-clock", frame_clock,
                               NULL);
+      display_wayland->toplevels = g_list_prepend (display_wayland->toplevels,
+                                                   surface);
+      g_warn_if_fail (!parent);
       break;
     case GDK_SURFACE_POPUP:
       surface = g_object_new (GDK_TYPE_WAYLAND_POPUP,
@@ -746,9 +749,6 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
 
   gdk_wayland_surface_set_title (surface, get_default_title ());
 
-  if (parent == NULL)
-    display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, surface);
-
   impl->transient_for = parent;
 
   gdk_wayland_surface_create_surface (surface);